<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="__STATIC__/js/jquery.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <script type="text/javascript" src="__STATIC__/x-admin/js/xadmin.js"></script>
    <link rel="stylesheet" href="__STATIC__/x-admin/css/font.css">
    <link rel="stylesheet" href="__STATIC__/x-admin/css/xadmin.css">
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css">
</head>
<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="#">基础设置</a>
        <a href="#">地区管理</a>
          <a href="#">添加市</a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:window.location.reload();" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div style="height: 50px"></div>
<div style="width: 800px">
    <form class="layui-form" action="" onsubmit="return false" name="type" id="save">
        <input type="hidden" name="id" value="{$cityInfo.id}">
        <div class="layui-form-item">
            <label class="layui-form-label">地区</label>
            <div class="layui-input-block">
                <input type="text" readonly value="{$cityInfo.region_name}" placeholder="地区" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <select name="is_pass">
                    <option value="0" {if $cityInfo.is_pass == 0} selected {/if}>关闭</option>
                    <option value="1" {if $cityInfo.is_pass == 1} selected {/if}>开通</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">总分</label>
            <div class="layui-input-block" style="width: 200px">
                <input type="number" name="total" value="{$cityInfo.total}" placeholder="总分" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">A</label>
                <div class="layui-input-inline">
                    <input type="number" name="grade_a" value="{$cityInfo.grade_a}" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">B</label>
                <div class="layui-input-inline">
                    <input type="number" name="grade_b" value="{$cityInfo.grade_b}" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">C</label>
                <div class="layui-input-inline">
                    <input type="number" name="grade_c" value="{$cityInfo.grade_c}" autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" id="update">立即修改</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
</body>
<script>
    $("#update").click(function(){
        $.ajax({
            url:"{:url('/region/saveInfo')}",
            type:"post",
            data:$("#save").serialize(),
            dataType:"json",
            success:function(res){
                if(res.code){
                    layer.msg(res.msg,{icon:1,time:2000});
                }else{
                    layer.msg(res.msg,{icon:5,time:2000});
                }
            }
        });
    });
</script>
</html>